package com.geline.uploadfile.pojo;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

/**
 * 格式：{"id": "ID",  "name": "文件名.txt", "status": "success", "key": "xxx", "url": "xxx", "percent": 100}
 * @author: mengxin
 * @date: 2022/3/26 9:33
 */
@Getter
@Setter
public class FileUpload implements Serializable {

    private String id = "";
    private String url; //文件访问地址
    private String key; //新文件名
    private String name; //原文件名
    private String status; //上传状态 success/fail
    private Integer percent; //上传进度
    private Long fileSize;//文件大小

    public FileUpload(){
    }

    public FileUpload(String id, String url, String name){
        this.id = id;
        this.url = url;
        this.name = name;
        this.status = "success";
        this.percent = 100;
    }
}
